package com.bt.dmdb.enums;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Order;
import com.bt.dmdb.helpers.SqlBuilder;

public enum OrderBy {/*
    ASC {

        public void addOrder(DetachedCriteria criteria, String col) {
            criteria.addOrder(Order.asc(col).ignoreCase());
        }

        @Override
        public SqlBuilder addOrder(SqlBuilder builder, String col) {
            String query = builder.getQuery();
            builder.setQuery((new StringBuilder(query)).append(" order by \"").append(col).append("\"").toString());
            return builder;
        }
    },
    DESC {

        public void addOrder(DetachedCriteria criteria, String col) {
            criteria.addOrder(Order.desc(col).ignoreCase());
        }

        @Override
        public SqlBuilder addOrder(SqlBuilder builder, String col) {
            String query = builder.getQuery();
            builder.setQuery((new StringBuilder(query)).append(" order by \"").append(col).append("\" desc").toString());
            return builder;
        }
    },
    NONE {

        public void addOrder(DetachedCriteria criteria, String col) {
        }

        @Override
        public SqlBuilder addOrder(SqlBuilder builder, String col) {
            return builder;
        }
    };

    public abstract void addOrder(DetachedCriteria criteria, String col);

    public abstract SqlBuilder addOrder(SqlBuilder builder, String col);
*/}
